package com.learn.seven;

import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @author ln
 * @Description: ${todo}
 * @date 2020/12/15
 */
public class testReentrantLock {

   static ReentrantLock reentrantLock= new ReentrantLock();

    public static void main(String[] args) throws InterruptedException {

//        创建一个新的条件变量（休息室）
        Condition condition1 = reentrantLock.newCondition();
        Condition condition2 = reentrantLock.newCondition();

        reentrantLock.lock();
//        进入休息室
        condition1.await();

        condition1.signal();

    }

}
